<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<style>
    #flag1{color: rgb(142, 216, 62);}
    #flag2{color: rgb(42, 129, 100);}
    #flag3{color: rgb(60, 216, 25);}
    #flag4{color: rgb(123, 72, 243);}
</style>

    <ul>
        <li id="flag1">鱼香茄子</li>
        <li id="flag2">凉拌黄瓜</li>
        <li id="flag3">宫保鸡丁</li>
        <li id="flag4">开水白菜</li>
    </ul>
    <script>
        var com1=document.getElementById('flang1');
        var com2=document.getElementById('flang2');
        var com3=document.getElementById('flang3');
        var com4=document.getElementById('flang4');

        console.log(flag1);
        console.log(flag2);
        console.log(flag3);
        console.log(flag4);
     </script>
</body>
</html>